package com.xudow.app.dynamicstate_old.module.recommend;

import android.os.Bundle;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.ViewGroup;

import com.jude.beam.bijection.RequiresPresenter;
import com.jude.beam.expansion.list.BeamListActivity;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.xudow.app.R;
import com.xudow.app.dynamicstate_old.domain.entity.RecommendTalent;
import com.xudow.app.dynamicstate_old.widget.MarginDecoration;

@RequiresPresenter(PreferredTalentPresenter.class)
public class PreferredTalentActivity extends BeamListActivity<PreferredTalentPresenter, RecommendTalent> {

    @Override
    public BaseViewHolder<RecommendTalent> getViewHolder(ViewGroup parent, int viewType) {
        return new PreferredTalentViewHolder(parent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        findViewById(R.id.back).setOnClickListener(v->finish());
        getListView().setLayoutManager(new StaggeredGridLayoutManager(2, OrientationHelper.VERTICAL));
        getListView().addItemDecoration(new MarginDecoration());
    }

    @Override
    public int getLayout() {
        return R.layout.activity_recomment_talent;
    }
}